<?php

class AdPhoto extends AppModel {
  public $name = 'AdPhoto';
  public $belongsTo = array('Ad'=>array(
      'className'=> 'Ad',
      'foreignKey'=>'ad_id',
      'type' =>'inner'
 ));
  public $validate = array(
      'AdPhoto.ad_id' => array(
          'rule' => 'notEmpty',
          'message'=>'Ad is required'
      ),
      'AdPhoto.image_path'=>array(
              'rule'=>array('validImageFormat'),
              'message'=>'Specify a valid image (gif, jpg, png)',
              'allowEmpty'=>true,
                'required'=>false
      ),
      'AdPhoto.title' => array(
          'rule' => 'notEmpty',
          'message'=>'Title is required'
      )
  );
   
  
}

?>
